package com.example.demo123;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class test {
    String data="";      //存放互联网发来的数据
    //String[]  data;
    //ArrayList<String> data;
    @CrossOrigin
    @RequestMapping("getWeb")   //请求地址：http://localhost:9876/getWeb?data=xxx
    @ResponseBody
    public String getWeb(@RequestParam("data") String data){
        this.data=data;
        return "成功";

    }
    @CrossOrigin
    @RequestMapping("sendWeb")        //请求地址：http/localhost:9876/sendWeb
    @ResponseBody
    public String sendWed(){
        return data;
    }
    /** 允许访问read*/
    @CrossOrigin
    @RequestMapping("read")
    public String html(){
        return "read";
    }
}
